home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_11 / phillip2 / cips.h < prev    next >
C/C++ Source or Header  |  1993-06-04  |  4KB  |  145 lines

  1.  
  2.  
  3.       /************************************************************
  4.       *
  5.       *   file d:\cips\cips.h
  6.       *
  7.       *       Functions: This file contains no functions. It
  8.       *          contains declarations of the data structures used
  9.       *          by the C Image Processing Systems CIPS.
  10.       *
  11.       *   Purpose:
  12.       *      To declare data structures.
  13.       *
  14.       *   Modifications:
  15.       *      June 1990 = created
  16.       *
  17.       **********************************************************/
  18.  
  19. #include <stdio.h>
  20. #include <graph.h>
  21. #include <io.h>
  22. #include <fcntl.h>
  23. #include <dos.h>
  24. #include <math.h>
  25. #include <malloc.h>
  26. #include <string.h>
  27. #include <sys\types.h>
  28. #include <sys\stat.h>
  29.  
  30. #define MAX_NAME_LENGTH       80
  31. #define ROWS                 100
  32. #define COLS                 100
  33. #define GRAY_LEVELS          255
  34. #define PREWITT                1
  35. #define PEAK_SPACE            50
  36. #define PEAKS                 30
  37. #define KIRSCH                 2
  38. #define SOBEL                  3
  39. #define STACK_SIZE          4000
  40. #define STACK_FILE_LENGTH    500
  41. #define FORGET_IT            -50
  42. #define STACK_FILE     "f:stack"
  43.  
  44.  
  45.       /*********************************************
  46.       *
  47.       *   N O T E
  48.       *   P O R T A B I L I T Y   I S S U E
  49.       *
  50.       *   The next two statements help port the 
  51.       *   system to non-Microsoft C compilers.
  52.       *   
  53.       *   If you use Microsoft C, then you should
  54.       *   #define MSC 1     and
  55.       *   #undef  OTHERC
  56.       *   
  57.       *   If you are using another C compiler or
  58.       *   are porting this to another type of 
  59.       *   machine, then you should 
  60.       *   #undef  MSC
  61.       *   #define OTHERC 1
  62.       *   
  63.       *   Now you need to make changes in mymsc.c
  64.       *
  65.       **********************************************/
  66.  
  67. #define MSC 1
  68. #undef  OTHERC
  69.  
  70.       /*********************************************
  71.       *
  72.       *   N O T E
  73.       *   P O R T A B I L I T Y   I S S U E
  74.       *
  75.       *   Define the Microsoft contants.  If you
  76.       *   are using OTHERC, then just put numbers
  77.       *   there to hold a place.
  78.       *
  79.       *********************************************/
  80.  
  81. #ifdef MSC
  82. #define VRES16COLOR  _VRES16COLOR
  83. #define ERESCOLOR    _ERESCOLOR
  84. #define MAXCOLORMODE _MAXCOLORMODE
  85. #define HRESBW       _HRESBW
  86. #define MRES4COLOR   _MRES4COLOR
  87. #define TEXTC80      _TEXTC80
  88. #define GCLEARSCREEN _GCLEARSCREEN
  89. #endif
  90.  
  91. #ifdef OTHERC
  92. #define VRES16COLOR  1
  93. #define ERESCOLOR    1
  94. #define MAXCOLORMODE 1
  95. #define HRESBW       1
  96. #define MRES4COLOR   1
  97. #define TEXTC80      1
  98. #define GCLEARSCREEN 1
  99. #endif
  100.  
  101.       /**************************************************
  102.       *
  103.       *   The following struct defines the information
  104.       *   you need to read from the tiff file
  105.       *   header.
  106.       *
  107.       ***************************************************/
  108.  
  109. struct tiff_header_struct{
  110.    short lsb;
  111.    long  bits_per_pixel;
  112.    long  image_length;
  113.    long  image_width;
  114.    long  strip_offset;
  115. };
  116.  
  117.                 /*********************************************
  118.                 *
  119.                 *       The following four unions are used
  120.                 *       to put the bytes from the header
  121.                 *       into either an integer or a floating
  122.                 *       point number.
  123.                 *
  124.                 **********************************************/
  125.  
  126. union short_char_union{
  127.         short s_num;
  128.         char  s_alpha[2];
  129. };
  130.  
  131. union int_char_union{
  132.         int  i_num;
  133.    char i_alpha[2];
  134. };
  135.  
  136. union long_char_union{
  137.         long  l_num;
  138.         char  l_alpha[4];
  139. };
  140.  
  141. union float_char_union{
  142.         float f_num;
  143.         char  f_alpha[4];
  144. };
  145.